#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QInputDialog>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    QInputDialog::getInt(this, "对话框标题", "请输入一个整数");
}

void MainWindow::on_pushButton_2_clicked()
{
    QInputDialog::getDouble(this, "对话框标题", "请输入一个浮点数");
}

void MainWindow::on_pushButton_3_clicked()
{
    //创建字符串数组
    QStringList list;
    list.push_back("111");
    list.push_back("222");
    list.push_back("333");
    list.push_back("444");
    //创建条目输入对话框
    QInputDialog::getItem(this, "对话框标题", "请输入条目", list);
}
